<include file="Public:header"/>


<div class="right-bord">查询结果</div>
<div class="row">
    <div class="col-md-12">
        <div class="daily-chart" id="main">&nbsp;</div>
    </div>
</div>

<div class="table-tit">订单记录</div>
<table class="table table-bgfont">
    <tr>
        <th width="12%">订单编号</th>
        <th>客户</th>
        <th>优惠金额</th>
        <th>应付金额</th>
        <th>实际金额</th>
        <th>下单时间</th>
        <th>支付时间</th>
        <th>订单状态</th>
    </tr>

    <volist name="data.data" id="v">
        <tr>
            <td>{$v.ord_sn}</td>
            <td>{$v.ord_userid|getUserName=$v['ord_userid'],###}</td>
            <td>{$v.ord_discount}</td>
            <td>{$v.ord_amount}</td>
            <td>{$v['ord_amount']+$v['ord_discount']}</td>
            <td>{$v.ord_addtime|date='Y-m-d H:i:s',###}</td>
            <td>{$v.ord_paytime|date='Y-m-d H:i:s',###}</td>
            <td>
                <switch name='v.ord_status'>
        <case value="0"><button type="button" class="btn btn-warning btn-xs">等待支付</button></case>
        <case value="1"><button type="button" class="btn btn-success btn-xs">有效推广</button></case>
        <case value="2"><button type="button" class="btn btn-success btn-xs">有效推广</button></case>
        <case value="3"><button type="button" class="btn btn-success btn-xs">有效推广</button></case>
        <case value="4"><button type="button" class="btn btn-danger btn-xs">无效推广</button></case>
        <case value="5"><button type="button" class="btn btn-danger btn-xs">无效推广</button></case>
        </switch>
        </td>
        </tr>
    </volist>
    <tr>
        <td colspan="8">{$data.page}</td>
    </tr>
</table>

<script src="__PUBLIC__/libs/json2.js"></script>
<script src="__PUBLIC__/libs/echarts/echarts.js"></script>
<script>
    var category={$menulist};
    var nums={$datalist};
    var gold={$goldlist};
    
    require.config({
        paths: {
            echarts: '__PUBLIC__/libs/echarts'
        }
    });
    require(
            [
                'echarts',
                'echarts/chart/bar',
                'echarts/chart/line'
            ],
            function (ec) {
                // 基于准备好的dom，初始化echarts图表
                var myChart = ec.init(document.getElementById('main'));

                option = {
                    title: {text: '销售数据'},
                    tooltip: {trigger: 'axis'},
                    legend: {data: ['销售量','销售金额']},
                    toolbox: {
                        show: true,
                        feature: {
                            dataView: {show: true, readOnly: false},
                            magicType: {show: true, type: ['line', 'bar']},
                            restore: {show: true},
                            saveAsImage: {show: true}
                        }
                    },
                    calculable: true,
                    xAxis: [
                        {
                            type: 'category',
                            data: category
                        }
                    ],
                    yAxis: [{type: 'value'}],
                    series: [
                        {
                            name: '销售量',
                            type: 'bar',
                            data: nums
                        },
                        {
                            name: '销售金额',
                            type: 'bar',
                            data: gold
                        }
                    ]
                };


                // 为echarts对象加载数据 
                myChart.setOption(option);
            }
    );
</script>

<include file="Public:footer"/>
